

import aa = module("main/org/sdmx/model/v2/reporting/dataset/AttachableArtefact");
/**
	* The value of an attribute, such as the instance of a Coded Attribute or
	* of an Uncoded Attribute in a structure such as a Key Family.
	* 
	* @author Xavier Sosnovsky, Anthony Morel
	*/ 
export class AttributeValue {
		
	/*==============================Fields================================*/
		
	private _attachesTo:aa.AttachableArtefact;
    
    /*===========================Constructor==============================*/
    
    constructor(attachmentTarget: aa.AttachableArtefact) {
		this.setAttachesTo(attachmentTarget);
	}
		
	/*============================Accessors===============================*/
		
	/**
		* @private
		*/ 
	public setAttachesTo(
        attachmentTarget: aa.AttachableArtefact) {
		if (null == attachmentTarget) {
			throw new Error("The attachment target cannot be null");	
		} else {
			this._attachesTo = attachmentTarget;
		}
	}
    
    /**
        * Associates the attribute to the object to which it is attached.
        */
    public getAttachesTo(): aa.AttachableArtefact {
		return this._attachesTo;
	}
}